import { useAxios } from '@/hooks/web/useAxios'
import { ReportYearVO,ReportYearPageReqVO,ReportYearExcelReqVO } from './types'

const request = useAxios()

// 查询年报列表
export const getReportYearPageApi = async (params: ReportYearPageReqVO) => {
    return await request.get({ url: '/water/report-year/page', params })
}

// 查询年报详情
export const getReportYearApi = async (id: number) => {
    return await request.get({ url: '/water/report-year/get?id=' + id })
}

// 新增年报
export const createReportYearApi = async (data: ReportYearVO) => {
    return await request.post({ url: '/water/report-year/create', data })
}

// 修改年报
export const updateReportYearApi = async (data: ReportYearVO) => {
    return await request.put({ url: '/water/report-year/update', data })
}

// 删除年报
export const deleteReportYearApi = async (id: number) => {
    return await request.delete({ url: '/water/report-year/delete?id=' + id })
}

// 导出年报 Excel
export const exportReportYearApi = async (params: ReportYearExcelReqVO) => {
    return await request.download({ url: '/water/report-year/export-excel', params })
}
